Контрольная работа 2, Николай Шестаков#18
Conversation
WoWaster
left a comment
There was a problem hiding this comment.
Есть пачка лишних файлов, давайте считать, что они уже вошли в балл для очереди
| #include <stdio.h> | ||
|
|
||
| /* | ||
| Compares two numbers in binary form без ведущих нулей, исключая число 0. |
There was a problem hiding this comment.
Ваш рунглиш звучит очень подозрительно
There was a problem hiding this comment.
Содержательно, с учётом ограничений похоже на правду. 10 баллов.
|
|
||
| /* | ||
| Pops value from the queue. | ||
| If queue is empty, returns -1. |
There was a problem hiding this comment.
Не лучшая идея, потому что -1 -- валидное значение, которое можно запихнуть в очередь
| struct ListElement* next; | ||
| struct ListElement* prev; |
There was a problem hiding this comment.
Не очень понимаю, зачем Вам здесь двусвязный список
| newElement->prev = queue->rHead; | ||
| queue->rHead = newElement; |
There was a problem hiding this comment.
Здесь, видимо старой голове нужно next заполнять
| currentElement->prev = temp; | ||
|
|
||
| previousElement = currentElement; | ||
| currentElement = currentElement->next; |
There was a problem hiding this comment.
Или даже что-то от tmp. Я честно говоря запутался с Вашими ссылками
| } | ||
|
|
||
| int value = queue->fHead->value; | ||
| ListElement* newHead = queue->fHead->prev; |
There was a problem hiding this comment.
Тестов маловато, косяков много, но вообще говоря, идею Вы поняли и если бы взяли обычные односвязные списки всё бы удалось, логика правильная :) 10 баллов.
Add